package cn.edu.jxau.admin.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class adminLoginServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	/**
		 * 
		 *管理员登陆密码验证
		 */
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
        String name=request.getParameter("name");
        String password=request.getParameter("password");
        if("admin".equals(name)&&"admin".equals(password)){
        	request.getSession().setAttribute("adminflag", "ok");
        	response.sendRedirect("admin/index.html");
        }else{
        	response.sendRedirect("admin/tips.html");
        }
	}

}
